using Godot;

namespace GoGameClient.script.node.create;

public partial class RoleButton : TextureButton
{
    [Signal]
    public delegate void ClickedEventHandler(int index);

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
    }

    public override void _Pressed()
    {
        //发送信号
        EmitSignal(SignalName.Clicked, int.Parse(Name));
        GetNode<AnimatedSprite2D>("AnimatedSprite2D").Visible = true;
    }

    public void SetVisible(bool visible)
    {
        GetNode<AnimatedSprite2D>("AnimatedSprite2D").Visible = visible;
    }

}